﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PreBookingTicket.aspx.cs" Inherits="PreBookingTicket" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" language="javascript">
        function addTr() {
            var listTable = document.getElementById("list");
            var listTbody = listTable.lastChild;
            var trNum;
            navigator.userAgent.toLowerCase().indexOf('firefox') > 0 ? trNum = listTbody.childNodes.length - 1 : trNum = listTbody.childNodes.length; //使火狐和IE生成相同的name
            var listTr = document.createElement("tr");
            var listTd1 = document.createElement("td");
            var listTd2 = document.createElement("td");
            var listTd3 = document.createElement("td");
            var listTd4 = document.createElement("td");
            var listTd5 = document.createElement("td");
            var langNameHtml = "<option value='1' selected=selected>头等舱</option><option value='2'>商务舱</option><option value='3'>经济舱</option>";
            listTd1.innerHTML ="<select>"+langNameHtml+"</select>";
            listTd2.innerHTML = "<input   name='UserName" + trNum + "' type='text'/>";
            listTd3.innerHTML = "<input  name='IDCar" + trNum + "' type='text'/>";
            listTd4.innerHTML = "<input  name='Phone" + trNum + "' type='text'/>";
            listTd5.innerHTML = "<input type='button' onclick='delTr(this)' value='删除' />";
            listTr.appendChild(listTd1);
            listTr.appendChild(listTd2);
            listTr.appendChild(listTd3);
            listTr.appendChild(listTd4);
            listTr.appendChild(listTd5);
            listTbody.appendChild(listTr);
        }

        function delTr(obj) {
            obj.parentNode.parentNode.parentNode.removeChild(obj.parentNode.parentNode);
        }
    </script>
    <style type="text/css">
        #list
        {
            border-collapse: collapse;
            width: 500px;
        }
        #list tr th
        {
            background: #F0F5FB;
        }
        #list tr th, #list tr td
        {
            border: slid 1px #EDEDED;
        }
    </style>
    <link rel="Stylesheet" type="text/css" href="Style/StyleSheet.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="MaxConten" style="width:1200px; height:800px">
        <div class="Mainconten" style="width:1000px;height:800px; margin:0 auto">
            <h1 style="text-align:center; color: Lime">飞机票预订</h1>
            <div><span>机票信息</span></div>
            <div class="GridViewInfo" style="width:100%; height:150px">
                <asp:GridView ID="GridView_lookup" runat="Server" class="GridViewStyle" 
                    AutoGenerateColumns="false" CellPadding="2" ForeColor="#333333" 
                    GridLines="None" BorderStyle="Ridge"  PageSize="1" Height="120px">
                    <FooterStyle BackColor="#990000" Font-Bold="true" ForeColor="White" />
                    <Columns>
                <asp:TemplateField HeaderText="航班编号">
                    <EditItemTemplate>
                        &nbsp;<asp:Label ID="Label3" runat="server" Text='<%# Bind("FlightID") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("FlightID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="航班号">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("FlightNumber") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FlightNumber") %>'></asp:Label>
                    </ItemTemplate>              
                </asp:TemplateField>
                <asp:TemplateField HeaderText="飞机型号">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FlightType") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FlightType") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="头等舱">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FirstSeat") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FirstSeat") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="头等舱票价 ">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FirstSeatPrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FirstSeatPrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="商务舱">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("BusinessSeat") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("BusinessSeat") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="商务舱票价">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("BusinessSeatPrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("BusinessSeatPrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="经济舱">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EconomicSeat") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("EconomicSeat") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="经济舱票价">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EconomicSeatPrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("EconomicSeatPrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="出发地">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FromAddress") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FromAddress") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="目的地">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ToAddress") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("ToAddress") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="出发时间">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FromDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FromDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="到达时间 ">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ToDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("ToDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="出发时刻 ">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FromTime") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FromTime") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                    </Columns>
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="true" ForeColor="White" />
                    <PagerStyle BackColor="white" ForeColor="#0000066" HorizontalAlign="Left" />
                    <HeaderStyle BackColor="#006699" Font-Bold="true" ForeColor="White" />
                </asp:GridView>
            </div>
            <div class="TicketStyle">
                <span>订票人信息</span>
              <!--   <asp:GridView runat="Server" class="GridViewStyle" id="Gridview_User"
                    AutoGenerateColumns="false" CellPadding="10" ForeColor="#333333" 
                    GridLines="None" BorderStyle="Ridge" PageSize="1" Width="993px" >
                        <Columns>
                            <asp:TemplateField HeaderText="座位类型">
                    <EditItemTemplate>
                        &nbsp;<asp:Label ID="Label3" runat="server" Text='<%# Eval("SeatType") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("SeatType") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                            <asp:TemplateField HeaderText="乘客姓名">
                    <EditItemTemplate>
                        &nbsp;<asp:Label ID="Label3" runat="server" Text='<%# Eval("UserName") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("UserName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                            <asp:TemplateField HeaderText="证件号码">
                    <EditItemTemplate>
                        &nbsp;<asp:Label ID="Label3" runat="server" Text='<%# Eval("UserIDNumber") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("UserIDNumber") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                            <asp:TemplateField HeaderText="手机号码">
                    <EditItemTemplate>
                        &nbsp;<asp:Label ID="Label3" runat="server" Text='<%# Eval("Phone") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Phone") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                    </Columns>
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="true" ForeColor="White" />
                    <PagerStyle BackColor="white" ForeColor="#0000066" HorizontalAlign="Left" />
                    <HeaderStyle BackColor="#006699" Font-Bold="true" ForeColor="White" />
                </asp:GridView> 
                -->
                <div class="UserInfo">
                    <input type="button" onclick="addTr()" value="添加用户" />
        <table id="list">
            <tr>
                <th>
                    座位类型
                </th>
                <th>
                    用户姓名
                </th>
                <th>
                    用户证件号
                </th>
                <th>
                    用户手机号
                </th>
                <th>
                    操作
                </th>
            </tr>
        </table>
                </div>
            </div>
            <div style="margin-top:20px">
                <table border="0" cellspacing="0" cellpadding="0" 
                    style="width: 63%;text-align:center; height: 37px; margin-left: 152px;">
                	<tr >
                		<td>
                            <asp:Button runat="Server" Text="提交订单"  ID="OK" BackColor="Blue" 
                                style="text-align:center;" Height="33px" onclick="OK_Click" Width="89px"></asp:Button>
                        </td>
                        <td>
                            <asp:Button ID="Cancell" runat="Server" Text="取消" BackColor="Chocolate" 
                                style="text-align:center" Height="34px" onclick="Cancell_Click" Width="65px"></asp:Button>
                        </td>
                	</tr>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
